import { http } from './toPromise'
// 接口列表
const url = {
    userLogin: "/index/grant/getOpenid",
    getMyCoin: "/index/my/myCoin",
    getMyComment: "/index/my/myComment",
    getMyLike: "/index/my/myLike",
    getMyPoint: "/index/my/myPoint",
    getDataList: "/index/index/lists",
    getRecommendToday: "/index/index/recommend",
    getDetails: "/index/index/detail",
    getComments: "/index/index/comments",
    toAddComment: "/index/index/addComment",
    toAddLike: "/index/index/addLike",
    getAdvList: "/index/adver/status",
    getMode: "/index/index/mode",
    getMobileAuth: "/index/my/mobileAuth",
    getRule: "/index/my/rule",
    getNewsData: "/index/article"
}
module.exports = {
    // 用户登录
    userLogin(params) {
        return http({      
            url: url.userLogin,
            data: params,
            method: 'GET'
        })
    },
    // 我的账户信息
    getMyCoin(params) {
        return http({      
            url: url.getMyCoin,
            data: params
        })
    },
    // 我的评论
    getMyComment(params) {
        return http({      
            url: url.getMyComment,
            data: params
        })
    },
    // 我的点赞
    getMyLike(params) {
        return http({      
            url: url.getMyLike,
            data: params
        })
    },
    // 积分明细
    getMyPoint(params) {
        return http({      
            url: url.getMyPoint,
            data: params
        })
    },
    // 首页模块列表
    getMode() {
        return http({
            url: url.getMode
        })
    },
    // 首页今日推荐
    getRecommendToday() {
        return http({
            url: url.getRecommendToday
        })
    },
    // 列表页
    getDataList(params) {
        return http({
            url: url.getDataList,
            data: params
        })
    },
    // 内容详情
    getDetails(params) {
        return http({
            url: url.getDetails,
            data: params,
        })
    },
    // 详情页评论数据
    getComments(params) {
        return http({
            url: url.getComments,
            data: params,
        })
    },
    // 发布评论
    toAddComment(params) {
        return http({
            url: url.toAddComment,
            data: params,
        })
    },
    // 点赞
    toAddLike(params) {
        return http({
            url: url.toAddLike,
            data: params,
        })
    },
    // 广告
    getAdvList() {
        return http({
            url: url.getAdvList
        })
    },
    // 手机号授权
    getMobileAuth(params) {
        return http({
            url: url.getMobileAuth,
            data: params
        })
    },
    // 金币规则
    getRule() {
        return http({
            url: url.getRule
        })
    },
    // 今日读报
    getNewsData(params) {
        return http({
            url: url.getNewsData,
            data: params
        })
    },
}